package com.zhangdi.demo.aop;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

@Aspect
@Component
public class CheckUserStateHandler {
    @Pointcut("@annotation(com.zhangdi.demo.aop.CheckUser)")
    public void pointcut(){}

    @Before("pointcut()")
    public Object check(JoinPoint point){
        System.out.println("pointcut   before");
        Object[] args = point.getArgs();
        for (Object arg : args) {
            System.out.println(arg);
        }
        return "1";
    }
}
